home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / doors / xpr / amixpr.asm next >
Encoding:
Assembly Source File  |  1992-12-26  |  31.7 KB  |  1,334 lines

  1.  
  2.  
  3.         SECTION  AMIXPR,CODE    ;(c)1992 Gellermann +49/621/715101-0
  4.  
  5.         incdir   "include/"
  6.         include  "exec/exec_lib.i"
  7.         include  "intuition/intuition.i"
  8.         include  "intuition/intuition_lib.i"
  9.         include  "libraries/dos_lib.i"
  10.         include  "libraries/dosextens.i"
  11.         include  "devices/serial.i"
  12.         include  "devices/timer.i"
  13.         include  "graphics/graphics_lib.i"
  14.         include  "graphics/text.i"
  15.  
  16.  
  17. _main
  18. ;-------------------------------;save commandline max 256byte
  19.     move.b    #0,CLBUFFER    ;kill old string in buffer
  20.     tst.l    d0
  21.     beq    cli_null
  22.     subq.l    #1,d0        ;a0 -> String, d0 = number of bytes (256max)
  23.     lea    CLBUFFER,a1    ;copy
  24. cli    move.b    (a0)+,(a1)+
  25.     dbra    d0,cli
  26.     move.b    #0,-(a1)    ;zero at the end
  27. cli_null
  28.  
  29. ;-------------------------------;OPEN LIBS
  30.  
  31.         moveq    #0,d0
  32.         lea      int_name(pc),a1
  33.         CALLEXEC OpenLibrary
  34.         tst.l    d0
  35.         beq      ClInt
  36.         lea      _IntuitionBase(pc),a0
  37.         move.l   d0,(a0)
  38. ;-------
  39.         moveq    #0,d0
  40.         lea      dos_name(pc),a1
  41.         CALLEXEC OpenLibrary
  42.         tst.l    d0
  43.         beq      ClDos
  44.         lea      _DOSBase(pc),a0
  45.         move.l   d0,(a0)
  46. ;-------
  47.         moveq    #0,d0
  48.         lea      graf_name(pc),a1
  49.         CALLEXEC OpenLibrary
  50.         tst.l    d0
  51.         beq      ClGraf
  52.         lea      _GfxBase(pc),a0
  53.         move.l   d0,(a0)
  54.  
  55.  
  56. ;----------------------------------------------------------------------
  57. ;----------------------------------------------------------------------
  58. ;----------------------------------------------------------------------
  59. ;located here bcuz the doslib must be open for printHELP but
  60. ;the xprlib must not be open since we have yet to determine
  61. ;the xpr_protocolname
  62.                 ;decode the switches
  63.     lea    CLBUFFER,a0
  64.  
  65.     tst.b    (a0)        ;"amixpr"
  66.     beq    no2DO
  67.     cmpi.b    #" ",(a0)       ;"amixpr "
  68.     beq    no2DO
  69. ;-------
  70. main_loop
  71.     cmpi.b    #"-",(a0)
  72.     bne    noSWITCH    
  73. ;-------
  74.     addq.l    #1,a0
  75.     bclr.b    #5,(a0)        ;cap. letters
  76. ;-------
  77.     cmpi.b    #"D",(a0)    
  78.     bne    noDEVICE
  79.         addq.l    #2,a0        ;jump switch+space
  80.     lea    device,a1
  81. device_loop
  82.     bset.b    #5,(a0)        ;devicename in small chars
  83.     move.b    (a0)+,(a1)+
  84.     tst.b    (a0)        ;break if "amixpr -x blabla",0
  85.     beq    no2DO
  86.     cmpi.b    #" ",(a0)
  87.     bne    device_loop        
  88.     move.b    #0,(a1)        ;terminate name with 0
  89.     addq.l    #1,a0        ;jump space
  90.     bra    main_loop
  91. noDEVICE
  92. ;-------
  93.     cmpi.b    #"P",(a0)    
  94.     bne    noPROTOCOL
  95.         addq.l    #2,a0
  96.     lea    protocol,a1
  97. protocol_loop
  98.     bset.b    #5,(a0)        ;libname in small chars
  99.     move.b    (a0)+,(a1)+
  100.     tst.b    (a0)
  101.     beq    no2DO
  102.     cmpi.b    #" ",(a0)
  103.     bne    protocol_loop        
  104.     move.b    #0,(a1)        ;terminate name with 0
  105.     addq.l    #1,a0        ;jump space
  106.     bra    main_loop
  107. noPROTOCOL
  108. ;-------
  109.     cmpi.b    #"L",(a0)    
  110.     bne    noLOG
  111.         addq.l    #2,a0
  112.     lea    logfile,a1
  113. log_loop
  114.     move.b    (a0)+,(a1)+
  115.     tst.b    (a0)
  116.     beq    no2DO
  117.     cmpi.b    #" ",(a0)
  118.     bne    log_loop        
  119.     move.b    #0,(a1)        ;terminate name with 0
  120.     addq.l    #1,a0        ;jump space
  121.     bra    main_loop
  122. noLOG
  123. ;-------
  124.     cmpi.b    #"S",(a0)    ;WBENCHSCREEN=DEFAULT    
  125.     bne    noSCREEN
  126.         addq.l    #2,a0
  127.     lea    SPTR,a1        ;screenptr UDwindow
  128.     move.w    #CUSTOMSCREEN,STYPE
  129.     bsr    HEXStringULONG    ;a0^HEX$(8byte) a1^ULONG(4byte)
  130.     tst.b    (a0)
  131.     beq    no2DO
  132.     addq.l    #1,a0        ;jump space
  133.     bra    main_loop
  134. noSCREEN
  135. ;-------
  136.     cmpi.b    #"B",(a0)    
  137.     bne    noBATCH
  138.     addq.l    #2,a0
  139.     lea    BATCHPTR,a1    ;^list of path/filenames separated by
  140.     bsr    HEXStringULONG    ; spaces. terminated with zero.
  141.     tst.b    (a0)
  142.     beq    no2DO
  143.     addq.l    #1,a0        ;jump space
  144.     bra    main_loop
  145. noBATCH
  146. ;-------
  147.     cmpi.b    #"U",(a0)    
  148.     bne    noUNIT
  149.         addq.l    #2,a0
  150.     move.b    (a0)+,d0
  151.     sub.b    #"0",d0        ;ascii
  152.     move.b    d0,unit
  153.     tst.b    (a0)
  154.     beq    no2DO
  155.     addq.l    #1,a0        ;jump space
  156.     bra    main_loop
  157. noUNIT
  158. ;-------
  159.     cmpi.b    #"I",(a0)    
  160.     bne    noINIT
  161.         addq.l    #2,a0        ;jump switch+space
  162.     lea    xprinit,a1
  163. init_loop
  164.     move.b    (a0)+,(a1)+
  165.     tst.b    (a0)
  166.     beq    no2DO
  167.     cmpi.b    #" ",(a0)
  168.     bne    init_loop        
  169.     move.b    #0,(a1)        ;terminate name with 0
  170.     addq.l    #1,a0        ;jump space
  171.     bra    main_loop
  172. noINIT
  173. ;-------
  174.  
  175. no2DO
  176.     bsr    printHELP
  177.         bra    ClXpr        ;unknown switch: EXIT
  178.  
  179. ;-------
  180. noSWITCH
  181.     move.l    a0,Pointer    ;save current position!!
  182.  
  183. ;----------------------------------------------------------------------
  184. ;----------------------------------------------------------------------
  185. ;----------------------------------------------------------------------
  186.  
  187.         moveq    #0,d0
  188.         lea      protocol,a1
  189.         CALLEXEC OpenLibrary
  190.         tst.l    d0
  191.         bne      XPRok
  192.         CALLDOS  Output
  193.         move.l   d0,d1
  194.         move.l   #XPRmsg,d2
  195.         move.l   #XPRmsgLen,d3
  196.         CALLDOS  Write
  197.         bra      ClXpr
  198. XPRok
  199.         move.l   d0,_XPRBase
  200.  
  201. ;---------------------------------------;OPEN FONT
  202.     lea     MyAttr,a0        ;open the topaz8.font bcuz of
  203.     CALLGRAF OpenFont        ;possible WB2.0 trouble
  204.     tst.l     d0
  205.     beq     ClFont
  206.     move.l     d0,MyFont
  207.  
  208. ;---------------------------------------;OPEN DEVICES
  209.  
  210.         lea      SerIO,a1        ;IOExtSer Struktur
  211.         clr.l    d0         
  212.         clr.l    d1
  213.     move.b     unit,d0
  214.         move.b   #$B4,IO_SERFLAGS(a1)    ;set radboogie,7wire,(shared=b4)
  215.         lea      device,a0        ;exclusive = $94
  216.         CALLEXEC OpenDevice
  217.         tst.l    d0
  218.         bne      ClSer
  219.  
  220.         sub.l    a1,a1            ;Replyport einrichten
  221.         CALLEXEC FindTask        ;eigenen Task eintragen
  222.         lea      SerReply,a1
  223.         move.l   d0,MP_SIGTASK(a1) 
  224.         CALLEXEC AddPort        ;reply (message-)port einrichten
  225.         lea      SerIO,a1        ;replyport eintragen
  226.         move.l   #SerReply,MN_REPLYPORT(a1)
  227.  
  228. ;-------
  229.         lea      TimeIO,a1        ;timer.device
  230.         move.l   #UNIT_MICROHZ,d0
  231.         clr.l    d1
  232.         lea      timer_name,a0
  233.         CALLEXEC OpenDevice
  234.         tst.l    d0
  235.         bne      ClTimer
  236.  
  237.         sub.l    a1,a1
  238.         CALLEXEC FindTask
  239.         lea      TimeReply,a1
  240.         move.l   d0,MP_SIGTASK(a1)
  241.         CALLEXEC AddPort
  242.         lea      TimeIO,a1        ;replyport eintragen
  243.         move.l   #TimeReply,MN_REPLYPORT(a1)
  244.  
  245.  
  246. ;---------------------------------------;ALLOC RAM
  247.     move.l    #10000,d0        ;Logbuffer
  248.     move.l    #$30001,d1
  249.     CALLEXEC    AllocMem
  250.     tst.l    d0
  251.     beq    noRAM
  252.     move.l    d0,LBMin
  253.     move.l    d0,log_pointer
  254.  
  255. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  256.         bsr      MAINEVENT
  257. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  258.  
  259.         move.l    LBMin,a1
  260.         move.l    #10000,d0
  261.         CALLEXEC    FreeMem
  262. noRAM
  263.         lea      TimeIO,a1
  264.         CALLEXEC CloseDevice
  265.         lea      TimeReply,a1
  266.         CALLEXEC RemPort
  267. ClTimer
  268.         lea      SerIO,a1
  269.         CALLEXEC CloseDevice
  270.         lea      SerReply,a1
  271.         CALLEXEC RemPort
  272. ClSer
  273.     move.l     MyFont,a1
  274.     CALLGRAF CloseFont
  275. ClFont
  276.         move.l   _XPRBase,a1
  277.         CALLEXEC CloseLibrary
  278. ClXpr
  279.         move.l   _GfxBase,a1
  280.         CALLEXEC CloseLibrary
  281. ClGraf
  282.         move.l   _DOSBase,a1
  283.         CALLEXEC CloseLibrary
  284. ClDos
  285.         move.l   _IntuitionBase,a1
  286.         CALLEXEC CloseLibrary
  287. ClInt
  288.         move.l  #0,d0            ;Return Code 0 = OK
  289.         rts
  290.  
  291. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  292. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  293. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  294. MAINEVENT
  295.  
  296.     move.l    Pointer,a0
  297. ;-------
  298.     bclr.b    #5,(a0)            ;change to cap. letters
  299.         cmpi.b  #"R",(a0)
  300.         bne    noRECEIVE
  301.  
  302.         bsr    Receive
  303.     bsr    save_log
  304.     rts
  305.  
  306. noRECEIVE
  307.         cmpi.b  #"S",(a0)
  308.         bne    noSEND
  309.  
  310.         bsr    Send
  311.     bsr    save_log
  312.     rts
  313.  
  314. noSEND
  315.  
  316. ;-------
  317. printHELP
  318.         CALLDOS  Output            ;print helpfile if no valid cmd
  319.         move.l   d0,d1
  320.         move.l   #HelpTxt,d2
  321.         move.l   #HelpTxtLen,d3
  322.         CALLDOS  Write
  323.  
  324.     rts
  325.  
  326. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  327. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  328. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  329. Receive    ;"amixpr r path"
  330.     ;        ^Pointer
  331.  
  332.         lea      XPR_IO,a0
  333.         move.l   #xprinit,(a0)
  334.         move.l   _XPRBase,a6
  335.         jsr      -36(a6)        ;Setup general params
  336.  
  337.     move.l     Pointer,a2
  338.     addq.l     #1,a2
  339.     move.b     #"P",(a2)
  340.         lea      XPR_IO,a0
  341.         move.l   a2,(a0)
  342.         move.l   _XPRBase,a6
  343.         jsr      -36(a6)        ;Setup receive path
  344.  
  345.     bsr     openWINDOW
  346.  
  347.         lea      XPR_IO,a0
  348.         move.l   _XPRBase,a6
  349.         jsr      -48(a6)        ;Receive
  350.  
  351.     bsr     closeWINDOW
  352.  
  353.         lea      XPR_IO,a0
  354.         move.l   _XPRBase,a6
  355.         jsr      -30(a6)        ;Cleanup
  356.  
  357.         rts
  358.  
  359. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  360. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  361. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  362. Send    ;amixpr s path/name1 path/name2 ... 256bytes max (use -b !!!)
  363.     ;       ^Pointer
  364.  
  365.     bsr     openWINDOW
  366.  
  367.     tst.l     BATCHPTR        ;use -b switch?
  368.     beq     notBATCH        ;no (sniff)
  369.     move.l     BATCHPTR,a1            ;get batch from -b pointer
  370.     bra     SendOK
  371. notBATCH
  372.     move.l     Pointer,a1        ;get batch from cmdstring
  373.     addq.l     #2,a1
  374. SendOK
  375.     lea      XPR_IO,a0
  376.     move.l   a1,(a0)        ;give pointer to ffirst/fnext
  377.     move.l   _XPRBase,a6
  378.     jsr      -42(a6)        ;Send
  379.  
  380.     bsr     closeWINDOW
  381.  
  382.     lea      XPR_IO,a0
  383.     move.l   _XPRBase,a6
  384.     jsr      -30(a6)        ;Cleanup
  385.  
  386.     rts
  387.  
  388. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
  389. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
  390. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 
  391. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  392. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  393. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  394. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  395. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  396. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  397. ;--------------------------------------XPR CALLBACK ROUTINEN--------------
  398. ;
  399. ;----------------------------------xpr_fopen
  400. xpr_fopen    ;a0^FileName a1^Axxsmode return:d0=handle or 0
  401.  
  402.     move.l  a0,d1
  403.     move.b    (a1),d0
  404.     bclr.b    #5,d0        ;cap. letters
  405.     cmpi.b    #"R",d0
  406.         bne    noMODE_READ
  407.         move.l    #MODE_OLDFILE,d2
  408.         CALLDOS    Open        ;d1^name d2=modus
  409.     rts
  410.  
  411. noMODE_READ
  412.         cmpi.b    #"W",d0
  413.         bne    noMODE_WRITE
  414.         move.l    #MODE_NEWFILE,d2
  415.         CALLDOS    Open
  416.     rts
  417.  
  418. noMODE_WRITE
  419.         cmpi.b    #"A",d0
  420.         bne    noMODE_APPEND
  421.     move.l    d1,d5           ;save ^name
  422.         move.l    #MODE_OLDFILE,d2
  423.         CALLDOS    Open
  424.         tst.l    d0
  425.         bne    OPENok
  426.     move.l    d5,d1
  427.         move.l    #MODE_NEWFILE,d2
  428.         CALLDOS    Open
  429.     rts
  430. OPENok
  431.     move.l     d0,d5        ;save handle
  432.         move.l   d0,d1        ;goto end of file (append)
  433.         move.l   #0,d2
  434.         move.l   #OFFSET_END,d3
  435.         CALLDOS  Seek
  436.     move.l     d5,d0        ;handle in d0 must be returned
  437.     rts
  438.  
  439. noMODE_APPEND
  440.     clr.l    d0
  441.     rts            ;do nothing
  442.  
  443. ;----------------------------------xpr_fclose
  444. xpr_fclose
  445.     move.l    a0,d1
  446.     CALLDOS    Close
  447.  
  448.     bsr    build_log
  449.  
  450.     rts
  451.  
  452. ;the fclose is the only callback-routine that gets
  453. ;called after every filexfer in a batch
  454. ;so we build a string of log entries
  455. ;here and save it after the xprlib returns.
  456. ;----------------------------------xpr_fread
  457. xpr_fread
  458.              move.l  d1,d3  ;Laenge
  459.              move.l  a0,d2  ;Buffer
  460.              move.l  a1,d1  ;Handle
  461.              CALLDOS Read
  462.              rts
  463. ;----------------------------------xpr_fwrite
  464. xpr_fwrite
  465.              move.l  d1,d3  ;Laenge
  466.              move.l  a0,d2  ;Buffer
  467.              move.l  a1,d1  ;Handle
  468.              CALLDOS Write
  469.              rts
  470. ;----------------------------------xpr_fseek
  471. xpr_fseek
  472.              move.l  d1,d3  ;Modus offset_beginning/current/end
  473.              move.l  d0,d2  ;Abstand
  474.              move.l  a0,d1  ;Handle
  475.              subq.l  #1,d3
  476.              CALLDOS Seek
  477.              tst.l   d0
  478.              bmi.s   fseek1
  479.              clr.l   d0 ;0=success
  480. fseek1
  481.              rts
  482. ;----------------------------------xpr_finfo
  483. xpr_finfo
  484.  
  485.         MOVE.L  D0,-(SP)
  486.         MOVE.L  A0,D1
  487.         MOVE.L  #-2,D2
  488.         CALLDOS Lock
  489.         MOVE.L  D0,D1
  490.         BEQ     finfo2
  491.         MOVE.L  D0,-(SP)
  492.         MOVE.L  D0,D1
  493.         MOVE.L  #FIB,D2
  494.         CALLDOS Examine
  495.         MOVE.L  (SP)+,D1
  496.         CALLDOS UnLock
  497.         MOVE.L  (SP),D0
  498.         CMP.L   #2,D0
  499.         BEQ     finfo1
  500.         CMP.L   #1,D0
  501.         BNE     finfo2
  502.         lea     FIB,a0
  503.         move.l  124(a0),d0 ;anzahl bytes
  504.         BRA     finfo3
  505. finfo1  CLR.L   D0
  506.         BRA     finfo3
  507. finfo2  CLR.L   D0
  508. finfo3  CLR.L   (SP)+
  509.         RTS
  510. ;----------------------------------xpr_update
  511. xpr_update
  512. ;the most important routine for isdn: gets called between
  513. ;every 1k block transfered.. keep it very simple and fast ore it
  514. ;will take away 2000cps.. no `%complete` calculation and stuff..
  515.  
  516.         move.l  a0,Asave        ;save ptr to xpr_update (build_log)
  517.     move.l    (a0),d5        ;update mask (what fields have changed)
  518.  
  519.     cmpi.l    #-1,SPTR
  520.     beq    update_end    ;no-xfer-window mode
  521. ;-------
  522.     btst.l    #1,d5    
  523.     beq    noFileName
  524.  
  525.         move.l  #11*8,d0    
  526.         move.l  #20,d1        ;filename
  527.         bsr     updatemove
  528.     move.l    #Fill,a0
  529.     move.l    #40,d0
  530.     bsr    updatetext
  531.         move.l  #11*8,d0    
  532.         move.l  #20,d1
  533.         bsr     updatemove
  534.         move.l  Asave,a0
  535.         move.l  8(a0),a0    ;^Fname
  536.         clr.l   d0
  537.         move.l  a0,a1
  538. update0
  539.     cmpi.b  #15,(a1)+
  540.         bcs     update4
  541.         addq.b  #1,d0
  542.     cmpi.b    #40,d0        ;print max 40 chars
  543.     bne    update0
  544. update4
  545.     bsr     updatetext
  546.  
  547. noFileName
  548. ;-------
  549.     btst.l    #2,d5    
  550.     beq    noFileSize
  551.  
  552.         move.l  Asave,a0
  553.         move.l  12(a0),d0    ;filesize
  554.         lea     Ruelps,a0
  555.         bsr     ULONGtoASCII
  556.         move.l  #11*8,d0
  557.         move.l  #30,d1
  558.         bsr     updatemove
  559.         lea     Ruelps,a0
  560.         move.l  #8,d0
  561.         bsr     updatetext
  562. noFileSize
  563. ;-------
  564.     btst.l    #3,d5    
  565.     beq    noMSG
  566.  
  567.         move.l  #1*8,d0    
  568.         move.l  #90,d1
  569.         bsr     updatemove
  570.     move.l    #Fill,a0
  571.     move.l    #50,d0
  572.     bsr    updatetext
  573.         move.l  #1*8,d0    
  574.         move.l  #90,d1
  575.         bsr     updatemove
  576.         move.l  Asave,a0
  577.         move.l  16(a0),a0
  578.         clr.l   d0
  579.         move.l  a0,a1
  580. update00
  581.     cmpi.b  #15,(a1)+
  582.         bcs     update44
  583.         addq.b  #1,d0
  584.     cmpi.b    #50,d0        ;print max 50 chars
  585.     bne    update00
  586. update44
  587.     bsr     updatetext
  588. noMSG
  589. ;-------
  590.     btst.l    #4,d5
  591.     beq    noERROR
  592.  
  593.         move.l  #1*8,d0    
  594.         move.l  #100,d1    
  595.         bsr     updatemove
  596.     move.l    #Fill,a0
  597.     move.l    #50,d0
  598.     bsr    updatetext
  599.         move.l  #1*8,d0    
  600.         move.l  #100,d1    
  601.         bsr     updatemove
  602.         move.l  Asave,a0
  603.         move.l  20(a0),a0
  604.         clr.l   d0
  605.         move.l  a0,a1
  606. update000
  607.     cmpi.b  #15,(a1)+
  608.         bcs     update444
  609.         addq.b  #1,d0
  610.     cmpi.b    #50,d0        ;print max 50 chars
  611.     bne    update000
  612. update444
  613.     bsr     updatetext
  614. noERROR
  615. ;-------
  616.     btst.l    #16,d5
  617.     beq    noCPS
  618.  
  619.         move.l  Asave,a0
  620.         move.l  68(a0),d0    ;cps
  621.         lea     Ruelps,a0
  622.         bsr     ULONGtoASCII
  623.         move.l  #11*8,d0
  624.         move.l  #70,d1
  625.         bsr     updatemove
  626.         lea     Ruelps,a0
  627.         move.l  #8,d0
  628.         bsr     updatetext
  629. noCPS
  630. ;-------
  631.     btst.l    #7,d5
  632.     beq    noBYTES
  633.  
  634.         move.l  Asave,a0    
  635.         move.l  32(a0),d0    ;position
  636.         lea     Ruelps,a0
  637.         bsr     ULONGtoASCII
  638.         move.l  #11*8,d0
  639.         move.l  #40,d1
  640.         bsr     updatemove
  641.         lea     Ruelps,a0
  642.         move.l  #8,d0
  643.         bsr     updatetext
  644. noBYTES
  645. ;-------
  646.     btst.l    #15,d5
  647.     beq    noELAPSED
  648.  
  649.         move.l  #11*8,d0
  650.         move.l  #60,d1
  651.         bsr     updatemove
  652.         move.l  Asave,a0
  653.         move.l  64(a0),a0    ;^elapsed time
  654.         move.l  #8,d0        ;maxlen
  655.         bsr     updatetext
  656. noELAPSED
  657. ;-------
  658.     btst.l    #14,d5
  659.     beq    noEXPECT
  660.  
  661.         move.l  #11*8,d0
  662.         move.l  #50,d1
  663.         bsr     updatemove
  664.         move.l  Asave,a0
  665.         move.l  60(a0),a0    ;^expect time
  666.         move.l  #8,d0        ;maxlen
  667.         bsr     updatetext
  668. noEXPECT
  669. ;-------
  670. update_end
  671.         rts
  672.  
  673. ;----------------------------------xpr_chkabort
  674. xpr_chkabort    ;abort if ESCAPE or CLOSEWINDOW or CARRIER LOST
  675.         ;also called between every 1k block
  676.  
  677.         move.l   UDwindowptr,a0    ;IDCMP-Windowport holen
  678.         move.l   wd_UserPort(a0),a0
  679.         CALLEXEC GetMsg
  680.         tst.l    d0
  681.         beq      noMESSAGE
  682.  
  683.         move.l   d0,a1
  684.         move.l   im_Class(a1),d4
  685.         move.w   im_Code(a1),d5 ;.Word!
  686.     CALLEXEC ReplyMsg
  687.  
  688.         cmpi.l   #CLOSEWINDOW,d4
  689.         beq      yoABORT
  690.     cmpi.l     #RAWKEY,d4
  691.     bne     xpr_chkabort
  692.     cmpi.b     #$45,d5
  693.     beq     yoABORT    ;escape key pressed (only when win active)
  694.         bra     xpr_chkabort     ;another msg?
  695.  
  696. noMESSAGE
  697.         bsr     xpr_squery     ;vielleicht zu lang fuer isdn?
  698.     move.w     IO_STATUS(a1),d0
  699.         btst     #5,d0        ;CARRIER LOST?
  700.     bne     yoABORT
  701. noABORT
  702.         clr.l   d0 
  703.         rts
  704. yoABORT
  705.         move.l   #-1,d0        ;d0 nonzero = abort
  706.         rts
  707.  
  708.  
  709. ;----------------------------------xpr_chkmisc
  710. xpr_chkmisc 
  711.     rts
  712. ;----------------------------------xpr_sread
  713. xpr_sread
  714.  
  715.         move.l   a0,Anull    ;IO_DATA
  716.         move.l   d0,Dnull       ;IO_LENGTH
  717.         move.l   d1,Deins    ;timeout or 0
  718.  
  719.         tst.l    d1        ;timeout gefordert ?
  720.         bne      wantsTIMEOUT    ;wenn ja
  721.  
  722.         bsr      xpr_squery     ;read all bytes available
  723.         tst.l    d0        ;IO_ACTUAL
  724.         bne      sumTHERE
  725.         rts                     ;return with count=0
  726.  
  727. sumTHERE
  728.         cmp.l    Dnull,d0
  729.         bcc      readOK        ;more than asked for?
  730.         move.l   d0,Dnull    ;read only as much as requested
  731. readOK
  732.         lea      SerIO,a1
  733.         move.w   #CMD_READ,IO_COMMAND(a1)
  734.         move.l   Dnull,IO_LENGTH(a1)
  735.         move.l   Anull,IO_DATA(a1)
  736.         CALLEXEC DoIO
  737.         move.l   IO_ACTUAL(a1),d0
  738.         rts
  739.  
  740.  
  741. wantsTIMEOUT
  742.         lea      SerIO,a1
  743.         move.w   #CMD_READ,IO_COMMAND(a1)
  744.         move.l   Dnull,IO_LENGTH(a1)
  745.         move.l   Anull,IO_DATA(a1)
  746.         CALLEXEC SendIO        ;DoIO would not return
  747.  
  748.         lea      TimeIO,a1
  749.         move.w   #TR_ADDREQUEST,IO_COMMAND(a1)
  750.         move.l   Deins,$24(a1)    ;timeout in microsecs
  751.         move.l   #0,$20(a1)    ;0 secs
  752.         CALLEXEC SendIO
  753.  
  754. ;--------
  755. waitEVENT
  756.         clr.l    d0        ;wait: either asked # of bytes arrive or
  757.         clr.l    d1        ;timerequest returns (timeout)
  758.  
  759.         lea      SerReply,a1    ;generate waitmaske
  760.         move.b   MP_SIGBIT(a1),d1
  761.         bset.l   d1,d0
  762.  
  763.         lea      TimeReply,a1
  764.         move.b   MP_SIGBIT(a1),d1
  765.         bset.l   d1,d0
  766.  
  767.         CALLEXEC Wait        ;timeout!enough_bytes
  768.  
  769. ;--------
  770.         lea      SerIO,a1    ;ok, iam back who signaled me?
  771.         CALLEXEC CheckIO    ;was it the SerReq?
  772.         beq      noSERIAL
  773.         CALLEXEC WaitIO        ;SERIAL did it: cleanup serial
  774.  
  775.         lea      TimeIO,a1    ;abort timer
  776.         CALLEXEC AbortIO
  777.         lea      TimeIO,a1
  778.         CALLEXEC WaitIO        ;cleanup timer
  779.  
  780.         lea      SerIO,a1
  781.         move.l   IO_ACTUAL(a1),d0 ;probably the IO_ACTUAL = # of asked bytes
  782.         rts
  783.  
  784. ;-------
  785. noSERIAL
  786.         lea      TimeIO,a1    ;timeout?
  787.         CALLEXEC CheckIO
  788.         beq      noTIMER    ;something else did it...return to sleep
  789.         CALLEXEC WaitIO        ;TIMER did it: cleanup timer
  790.  
  791.         lea      SerIO,a1    ;abort serial
  792.         CALLEXEC AbortIO
  793.         lea      SerIO,a1
  794.         CALLEXEC WaitIO        ;cleanup serial
  795.  
  796.         lea      SerIO,a1
  797.         move.l   IO_ACTUAL(a1),d0 ;probably IO_ACTUAL=0
  798.         rts
  799. ;-------
  800. noTIMER
  801.     bra     waitEVENT
  802.  
  803. ;----------------------------------xpr_swrite
  804. xpr_swrite
  805.  
  806.         lea      SerIO,a1
  807.         move.w   #CMD_WRITE,IO_COMMAND(a1)
  808.         move.l   d0,IO_LENGTH(a1)
  809.         move.l   a0,IO_DATA(a1)
  810.         CALLEXEC DoIO
  811.         rts
  812. ;----------------------------------xpr_sflush
  813. xpr_sflush
  814.  
  815.         lea      SerIO,a1
  816.         move.w   #CMD_FLUSH,IO_COMMAND(a1)
  817.         CALLEXEC DoIO
  818.         rts
  819. ;----------------------------------xpr_squery
  820. xpr_squery
  821.  
  822.         lea      SerIO,a1
  823.         move.w   #SDCMD_QUERY,IO_COMMAND(a1)
  824.         CALLEXEC DoIO
  825.         move.l   IO_ACTUAL(a1),d0
  826.         rts
  827. ;----------------------------------xpr_unlink
  828. xpr_unlink
  829.  
  830.         MOVE.L  A0,D1
  831.         CALLDOS DeleteFile
  832.         TST.L   D0
  833.         BEQ     unlink1
  834.         MOVEQ   #-$1,D0
  835.         BRA     unlink2
  836. unlink1 CLR.L   D0
  837. unlink2 RTS
  838. ;---------------------------------xpr_getptr
  839. xpr_getptr
  840.         CLR.L        D0
  841.         RTS
  842. ;---------------------------------xpr_options
  843. xpr_options
  844.         RTS
  845. ;---------------------------------xpr_ffirst
  846. xpr_ffirst    ;a0^buffer in which we must copy the first filename,0
  847.         ;a1^xpr_filename (from lib-call)
  848.  
  849.     tst.b    (a1)        ;"amixpr s ",0
  850.     beq    ffirst_null
  851.     cmpi.b    #" ",(a1)    ;"amixpr s  ",0
  852.     beq    ffirst_null
  853.  
  854. ffirst_loop
  855.     move.b    (a1)+,(a0)+
  856.  
  857.     tst.b    (a1)
  858.     beq    ffirst_end    
  859.  
  860.     cmpi.b    #" ",(a1)
  861.     beq    ffirst_end
  862.     bra    ffirst_loop
  863.  
  864. ffirst_end
  865.     move.b    #0,(a0) ;terminate name with zero
  866.     move.l    a1,d0    ;wird fnext uebergeben in d0!
  867.         rts
  868.  
  869. ffirst_null
  870.     clr.l    d0    ;no file found
  871.         rts
  872. ;---------------------------------xpr_fnext
  873. xpr_fnext    ;a0^buffer for the next filename
  874.  
  875.     move.l    d0,a1        ;erwarte in d0 ^ auf ende vom letzten namen
  876.                                 ;                   oldname oldname
  877.     tst.b    (a1)+           ;                                  ^
  878.     beq    fnext_null    ;"oldname",0
  879.     tst.b    (a1)
  880.     beq    fnext_null    ;"oldname ",0
  881.     cmpi.b    #" ",(a1)
  882.     beq    fnext_null      ;"oldname  "
  883.  
  884. fnext_loop
  885.     move.b    (a1)+,(a0)+
  886.  
  887.     tst.b    (a1)
  888.     beq    fnext_end    
  889.  
  890.     cmpi.b    #" ",(a1)    ;liest solange bis er ein space findet    
  891.     beq    fnext_end
  892.     bra    fnext_loop
  893.  
  894. fnext_end
  895.     move.b    #0,(a0)
  896.     move.l    a1,d0
  897.     rts
  898.  
  899. fnext_null
  900.     clr.l    d0    ;no file found
  901.         rts
  902.  
  903.  
  904. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  905. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  906. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  907. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  908. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  909. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  910. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  911. ;-=-=-=-= PROCEDURES -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  912.  
  913.  
  914. ;----------------------------------
  915. updatemove                         ;d0=x;d1=y
  916.         move.l   UDwindowptr,a1
  917.         move.l   wd_RPort(a1),a1
  918.         CALLGRAF Move                
  919.         rts
  920. updatetext                         ;a0=^buffer;d0=anzahl
  921.         move.l   UDwindowptr,a1
  922.         move.l   wd_RPort(a1),a1
  923.         CALLGRAF Text
  924.         rts
  925.  
  926. ;----------------------------------
  927. save_log    ;save/append the logbuffer to the logfile
  928.  
  929.         move.l   #logfile,d1
  930.         move.l   #MODE_OLDFILE,d2
  931.         CALLDOS  Open
  932.         move.l   d0,log_handle
  933.         tst.l      d0        ;0 = not found
  934.         bne      isOPEN
  935.  
  936.         move.l   #logfile,d1
  937.         move.l   #MODE_NEWFILE,d2
  938.         CALLDOS  Open
  939.         move.l   d0,log_handle
  940.     tst.l     d0
  941.     beq     cannotOPEN
  942. isOPEN
  943.         move.l   log_handle,d1    ;goto end of file (append)
  944.         move.l   #0,d2
  945.         move.l   #OFFSET_END,d3
  946.         CALLDOS  Seek
  947. ;-------
  948.     move.l     log_handle,d1
  949.     move.l     LBMin,d2
  950.     move.l     log_count,d3
  951.     CALLDOS     Write
  952. ;-------
  953.         move.l   log_handle,d1
  954.         CALLDOS  Close
  955.  
  956. cannotOPEN
  957.         rts
  958.  
  959.  
  960. ;---------------------------------------;
  961. build_log
  962. ;xfer is aborted/unsuccesful if line2 is not equal line3
  963. ;or if no log-entry exists for that transfer
  964.  
  965.     movem.l    d0-d6/a0-a6,-(sp)
  966.  
  967.     move.l     log_pointer,a0
  968.     move.l     Asave,a3    
  969. line_1
  970.         move.l   8(a3),a2   ;Filename
  971.         bsr      printstring
  972. line_2
  973.         move.l   12(a3),d0  ;FileSize
  974.         add.l     #9,log_count
  975.         bsr      ULONGtoASCII
  976.     move.b     #10,(a0)+
  977. line_3
  978.         move.l   32(a3),d0  ;bytes really transfered
  979.         add.l     #9,log_count
  980.         bsr      ULONGtoASCII
  981.     move.b     #10,(a0)+
  982. line_4
  983.         move.l   60(a3),a2  ;APX Time        INVALID WHEN XFER ABORTED!!
  984.         bsr      printstring                     (garble in this line)
  985. line_5
  986.         move.l   64(a3),a2  ;Elapsed Time    INVALID WHEN XFER ABORTED!!
  987.         bsr      printstring                         (garbled too)
  988. line_6
  989.         move.l   68(a3),d0  ;CPS RATE
  990.         add.l     #9,log_count
  991.         bsr      ULONGtoASCII
  992.     move.b     #10,(a0)+
  993. line_7
  994.         move.l   36(a3),d0  ;number of errors
  995.         add.l     #9,log_count
  996.         bsr      ULONGtoASCII
  997.     move.b     #10,(a0)+
  998. line_8
  999.         move.l   40(a3),d0  ;number of timeouts
  1000.         add.l     #9,log_count
  1001.         bsr      ULONGtoASCII
  1002.     move.b     #10,(a0)+
  1003.  
  1004.     move.l     a0,log_pointer
  1005.  
  1006.     movem.l    (sp)+,d0-d6/a0-a6
  1007.         rts
  1008.  
  1009. ;---------------------------------------;
  1010. printstring
  1011.     cmpi.b   #15,(a2)
  1012.     bcs      print_end
  1013.  
  1014.     move.b     (a2)+,(a0)+
  1015.     addq.l   #1,log_count
  1016.     bra      printstring
  1017. print_end
  1018.     move.b   #10,(a0)+        ;EOL
  1019.     addq.l   #1,log_count
  1020.     rts
  1021.  
  1022. ;---------------------------------------;
  1023.  
  1024.  
  1025.  
  1026. ;---------------------------------------;
  1027. openWINDOW
  1028.     cmpi.l     #-1,SPTR
  1029.     beq     noopenWINDOW        ;-1 = no xfer window
  1030.  
  1031.     lea    UDwindowdef(pc),a0    ;infowindow auf.
  1032.     CALLINT    OpenWindow
  1033.     move.l    d0,UDwindowptr
  1034.  
  1035.     move.l    UDwindowptr,a1
  1036.     move.l    wd_RPort(a1),a1
  1037.     move.l    #1,d0
  1038.     CALLGRAF    SetAPen        ;colour of text in window
  1039.  
  1040.     move.l    UDwindowptr,a1
  1041.     move.l    wd_RPort(a1),a1
  1042.     move.l    MyFont,a0
  1043.     CALLGRAF    SetFont
  1044.  
  1045.     move.l    #1*8,d0    
  1046.     move.l    #76,d1            ;ypos stripe
  1047.     bsr    updatemove
  1048.  
  1049.     move    #51*8,d0    
  1050.     move    #76,d1    
  1051.     move.l  UDwindowptr,a1
  1052.     move.l    wd_RPort(a1),a1
  1053.     CALLGRAF    Draw
  1054.  
  1055.     moveq    #5,d5            ;Anzahl Zeilen -1
  1056. text    moveq    #1*8,d0            ;Text ausgeben
  1057.     move.l    yps,d1
  1058.     move.l    UDwindowptr,a1
  1059.     move.l    wd_RPort(a1),a1
  1060.     CALLGRAF    Move        ;Cursor setzen
  1061.     move.l    UDwindowptr,a1
  1062.     move.l    wd_RPort(a1),a1
  1063.     move.l    tex,a0
  1064.     moveq    #50,d0
  1065.     CALLGRAF    Text
  1066.     add.l    #10,yps            ;1 Zeile =10 Pixel hoch
  1067.     add.l    #50,tex            ;1 Zeile =20 Zeichen
  1068.     dbra    d5,text
  1069.  
  1070. noopenWINDOW
  1071.     rts
  1072. ;---------------------------------------;
  1073. closeWINDOW
  1074.     cmpi.l     #-1,SPTR
  1075.     beq     nocloseWINDOW        ;-1 = no xfer window
  1076.         move.l   UDwindowptr,a0
  1077.         CALLINT  CloseWindow        
  1078. nocloseWINDOW
  1079.     rts
  1080. ;---------------------------------------;
  1081.  
  1082.  
  1083.  
  1084. ;--------------------------------------------
  1085. ULONGtoASCII    ;a0->8byte Buffer for the String; d0=ULONG to work on
  1086.                 ;this is ULONGtoDecimalstring not ULONGtoHEX$
  1087.  
  1088.         movem.l    d1/d2/a1,-(a7)
  1089.  
  1090.         moveq    #7,d2    ;8 digits...
  1091.         lea.l    Potenzen,a1
  1092. next
  1093.         move    #"0",d1
  1094. make1
  1095.         addq    #1,d1
  1096.         sub.l    (a1),d0
  1097.         bcc    make1
  1098.         subq    #1,d1
  1099.         add.l    (a1),d0
  1100.         move.b    d1,(a0)+
  1101.         tst.l    (a1)+
  1102.         dbra    d2,next
  1103.  
  1104.         movem.l    (a7)+,d1/d2/a1
  1105.         rts
  1106.  
  1107. Potenzen    dc.l    10000000
  1108.         dc.l    1000000
  1109.         dc.l    100000
  1110.         dc.l    10000
  1111.         dc.l    1000
  1112.         dc.l    100
  1113.         dc.l    10
  1114.         dc.l    1
  1115.         dc.l    0
  1116.         cnop    0,4
  1117.  
  1118.  
  1119. ;---------------------------------------;
  1120. HEXStringULONG    ;a0^HEX$(8byte) a1^ULONG(4byte)
  1121.  
  1122.     movem.l    d0/d1/d2/a2,-(a7)    ;save the registers we use
  1123.     move.l    #3,d1            ;not a0! (must count on)
  1124. HEX00
  1125.     move.b    (a0)+,d0    ;get first asciibyte
  1126.     bset.b    #5,d0        ;only small chars. digits unchanged
  1127.     move.l    #15,d2          ;0123456789abcde or f
  1128.     lea    HEXTAB(pc),a2
  1129. HEX02
  1130.     cmp.b    (a2,d2),d0
  1131.     beq    HEX01
  1132.     dbra    d2,HEX02
  1133. HEX01
  1134.     mulu    #16,d2        ;d2=position in hextab (0-15)
  1135.     move.b    d2,(a1)        ;high nibble (*16)
  1136.     move.b    (a0)+,d0    ;same with the low nibble
  1137.     bset.b    #5,d0        ;change to small char
  1138.     move.l    #15,d2
  1139. HEX03
  1140.     cmp.b    (a2,d2),d0
  1141.     beq    HEX04
  1142.     dbra    d2,HEX03
  1143. HEX04
  1144.         add.b    d2,(a1)+    ;add to highnib
  1145.     dbra    d1,HEX00    ;4 times (e.g.: 00 c0 12 34)
  1146.     movem.l    (a7)+,d0/d1/d2/a2
  1147.     rts
  1148.  
  1149. HEXTAB    dc.b    "0123456789abcdef"
  1150.     cnop    0,4
  1151.  
  1152. ;---------------------------------------;
  1153.  
  1154. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1155. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1156. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1157. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1158. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1159. ;-=-=-=-= DATA -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1160.  
  1161. XPR_IO
  1162.     dc.l    0
  1163.     dc.l    xpr_fopen    ;a pointer to this struct must be given
  1164.     dc.l    xpr_fclose    ;whenever calling a xprlib function
  1165.     dc.l    xpr_fread
  1166.     dc.l    xpr_fwrite
  1167.     dc.l    xpr_sread
  1168.     dc.l    xpr_swrite
  1169.     dc.l    xpr_sflush
  1170.     dc.l    xpr_update
  1171.     dc.l    xpr_chkabort
  1172.     dc.l    xpr_chkmisc
  1173.     dc.l    0        ;xpr_gets    ;not implemented
  1174.     dc.l    0        ;xpr_setserial    ;not implemented
  1175.     dc.l    xpr_ffirst
  1176.     dc.l    xpr_fnext
  1177.     dc.l    xpr_finfo
  1178.     dc.l    xpr_fseek
  1179.     dc.l    4        ;alle 4 EXT fields programmiert
  1180.     dc.l    0
  1181.     dc.l    xpr_options    ;EXT1
  1182.     dc.l    xpr_unlink    ;EXT2
  1183.     dc.l    xpr_squery    ;EXT3
  1184.     dc.l    xpr_getptr    ;EXT4
  1185.     dc.l    0,0,0,0
  1186.     cnop    0,4
  1187.  
  1188. ;----------------------------------------------
  1189. SerIO        ds.b    96    ;IOExtSer  Alloc for Message and Replyports
  1190. SerReply    ds.b    48
  1191. ;----------------------------------------------
  1192. TimeIO        ds.b    48
  1193. TimeReply    ds.b    48
  1194. ;----------------------------------------------
  1195.         cnop    0,4
  1196.  
  1197. UDwindowdef
  1198.         dc.w    14*8,5*8    ;coordinates of left-top edge
  1199.         dc.w    52*8,14*8       ;x/y size
  1200.         dc.b    -1,-1
  1201.         dc.l    CLOSEWINDOW!RAWKEY
  1202.         dc.l    UDW_Gadgets!UDW_Extras
  1203.         dc.l    0
  1204.         dc.l    0
  1205.         dc.l    UDW_Title
  1206. SPTR        dc.l    0        ;SCREENPOINTER
  1207.         dc.l    0
  1208.         dc.w    0,0
  1209.         dc.w    0,0
  1210. STYPE        dc.w    WBENCHSCREEN    ;SCREENTYPE
  1211.         cnop    0,4
  1212.  
  1213. UDW_Gadgets    equ    WINDOWDRAG!WINDOWCLOSE
  1214. UDW_Extras    equ    SMART_REFRESH!ACTIVATE
  1215.         cnop    0,4
  1216.  
  1217. _DOSBase    dc.l    0
  1218. _XPRBase    dc.l    0
  1219. _IntuitionBase    dc.l    0
  1220. _GfxBase    dc.l    0
  1221. UDwindowptr    dc.l    0
  1222. log_handle    dc.l    0
  1223. Pointer        dc.l    CLBUFFER
  1224. Asave        dc.l    0
  1225. Anull        dc.l    0
  1226. Aeins        dc.l    0
  1227. Dnull        dc.l    0
  1228. Deins        dc.l    0
  1229. BATCHPTR    dc.l    0
  1230. LBMin        dc.l    0    ;^start of allocated logbuffer
  1231. log_pointer    dc.l    0    ;^same
  1232. log_count    dc.l    0    ;number of chars in logbuffer
  1233.         cnop    0,4
  1234.  
  1235. ;-------
  1236. MyAttr        dc.l    MyFontName
  1237.         dc.w    TOPAZ_EIGHTY
  1238.         dc.b    FS_NORMAL
  1239.         dc.b    FPF_ROMFONT
  1240.         cnop    0,4
  1241. MyFontName    dc.b    "topaz.font",0
  1242.         cnop    0,4
  1243. MyFont        dc.l    0
  1244. ;-------
  1245.  
  1246. Ruelps    dc.b    "........",0
  1247.     cnop    0,4
  1248. Fill    dc.b    "                                                  " ;LEN=50
  1249.     cnop    0,4
  1250. ;-------
  1251. msg    dc.b    "FileName:                                         " ;20
  1252.     dc.b    "FileSize:          :                              " ;30
  1253.     dc.b    "Position:          :                              " ;40
  1254.     dc.b    "APX Time:          :                              " ;50
  1255.     dc.b    " Elapsed:          :                              " ;60
  1256.     dc.b    "     CPS:          :                              " ;70
  1257.     cnop    0,4
  1258. tex    dc.l    msg        ;write-pointer
  1259. yps    dc.l    20        ;y-Startposition
  1260. ;-------
  1261.  
  1262. XPRmsg        dc.b    "can't find the xpr.library",13,10
  1263. XPRmsgLen    equ    *-XPRmsg
  1264.         cnop    0,4
  1265.  
  1266. UDW_Title    dc.b    "         AmiXpress Transfer Window               ",0
  1267.         cnop    0,4
  1268. int_name    INTNAME
  1269.         cnop    0,4
  1270. timer_name    TIMERNAME
  1271.         cnop    0,4
  1272. dos_name    DOSNAME
  1273.         cnop    0,4
  1274. graf_name    GRAFNAME
  1275.         cnop    0,4
  1276.  
  1277. xprinit        dc.b    "TN,AY,OR,KY,SN,RN,DN,F0,B32",0    ;defaults
  1278.         dc.b    "u can patch dizzzzzzzzzzzzzzzzzzzzzzzzz"
  1279.         cnop    0,4
  1280.  
  1281. device        dc.b    "serial.device",0
  1282.         dc.b    "u can patch dizzzzzzzzzzzzzzzzzzzzzzzzz"
  1283.         cnop    0,4
  1284.  
  1285. unit        dc.b    0
  1286.         cnop    0,4
  1287.  
  1288. protocol    dc.b    "xprzmodem.library",0
  1289.         dc.b    "u can patch dizzzzzzzzzzzzzzzzzzzzzzzzz"
  1290.         cnop    0,4
  1291.  
  1292. logfile        dc.b    "ram:amixpr.log",0
  1293.         dc.b    "u can patch dizzzzzzzzzzzzzzzzzzzzzzzzz"
  1294.         cnop    0,4
  1295.  
  1296. CLBUFFER    dc.b    "r ram:",0    ;commandline buffer
  1297.         ds.b    256
  1298.         cnop    0,4
  1299.  
  1300. FIB        ds.b    260        ;file-info-block alloc
  1301.         cnop    0,4
  1302.  
  1303. HelpTxt    
  1304.  dc.b "amixpr -p protocol................xprzmodem.library=DEFAULT  ",13,10
  1305.  dc.b "v0.92  -d device..................serial.device=DEFAULT      ",13,10
  1306.  dc.b "       -u unit(UBYTE->ASCII)......0=DEFAULT                  ",13,10
  1307.  dc.b "       -l logfile.................ram:amixpr.log=DEFAULT     ",13,10
  1308.  dc.b "       -b batchptr(ULONG->HEX$)...^list of files separated by",13,10
  1309.  dc.b "                                  spaces terminated by zero  ",13,10
  1310.  dc.b "       -s screenptr(ULONG->HEX$)..^screen to open on         ",13,10
  1311.  dc.b "                                  -s ffffffff =noXferWindow  ",13,10
  1312.  dc.b "       -i initstring..............TN,AY,OR,KY,SN,RN,DN,F0,B32",13,10
  1313.  dc.b "       r path.....................receive file(s)            ",13,10
  1314.  dc.b "       s path/name1 path/name2....send file(s)               ",13,10,10
  1315.  
  1316.  dc.b "e.g.: `amixpr -p xprymodem.library s file1 file2 file3`      ",13,10
  1317.  dc.b "      batchsend 3 files using xprymodem. cmdline=256char max!",13,10
  1318.  dc.b "      if -b is used the cmdline filenames will be ignored.   ",13,10
  1319.  dc.b "      the HEX$ must be exactly 8 ascii-chars: ` -s 00c3a0ee `",13,10,10
  1320.  
  1321.  dc.b "logfile: line1: filename 2: filesize 3: transfered bytes     ",13,10
  1322.  dc.b "             4: expected 5: elapsed time (invalid if aborted)",13,10
  1323.  dc.b "             6: cpsrate  7: #errors  8: #timeouts            ",13,10
  1324.  dc.b "             9: start of next log (batch xfer)               ",13,10
  1325.  
  1326. HelpTxtLen    equ *-HelpTxt
  1327.         cnop    0,4
  1328.  
  1329. ;---------------------------------------------------------------------
  1330.              END
  1331. ;---------------------------------------------------------------------
  1332.  
  1333.  
  1334.